/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.aurelius.testngexecutionlogger.message;

import java.util.Locale;
import org.springframework.context.MessageSource;

/**
 *
 * @author Lukasz
 */
public class MessageSourceFacadeImpl implements MessageSourceFacade {

    private MessageSource messageSource;
    private Locale defaultLocale = Locale.getDefault();

    @Override
    public String getMessage(String key) {
        return messageSource.getMessage(key, null, defaultLocale);
    }

    @Override
    public String getMessage(String key, String... values) {
        return messageSource.getMessage(key, values, defaultLocale);
    }

    public void setDefaultLocale(Locale defaultLocale) {
        this.defaultLocale = defaultLocale;
    }

    public void setMessageSource(MessageSource messageSource) {
        this.messageSource = messageSource;
    }

}
